<?php
/**
 * PHP
 */

class Action extends DbMysql {
	
	
	public function __construct()
    {
        /* 初始化数据库类 */
		$this->cls_mysql(DB_HOST, DB_USER, DB_PASS, DB_NAME,WS_CHARSET);
    }
	
	
	public function table($str)
    {
        return '`' . DB_NAME . '`.`' . PREFIX . $str . '`';
    }
	
	
	/**
	* 读取商城数据配置
	*/
	public function shop_config(){

		//文件路径名
		$_dir = $_SERVER['DOCUMENT_ROOT'].'/Mapi/public/config/';
		$file_name = $_dir.'shop_config.txt';
		
		//默认配置数据
		$shop_config = array('index_goods_number'=>8,'video_goods_number'=>8,'page_number'=>10);
		
	    //读取缓存
        if(!is_file($file_name))
		{
            return $shop_config;
        }else{
           $res = file_get_contents($file_name);
		   $shop_config = json_decode($res,TRUE);
		   
		   return $shop_config; 
        }
	}
	
	
}
?>